<table>
  <tr>
    <th <%= sort_td_class_helper "target_date" %>><%= sort_link_helper "Target date", "id" %></th>
    <th <%= sort_td_class_helper "youth_id" %>><%= sort_link_helper "Youth ID", "youth_id" %></th>
    <th <%= sort_td_class_helper "type" %>><%= sort_link_helper "Type", "type" %></th>
    <th <%= sort_td_class_helper "status" %>><%= sort_link_helper "Status", "status" %></th>
    <th <%= sort_td_class_helper "institution" %>><%= sort_link_helper "Institution", "institution" %></th>
    <th <%= sort_td_class_helper "data_collector" %>><%= sort_link_helper "Data collector", "data_collector" %></th>
  </tr>

  <% @data_collections.each do |dc| %>
    <tr class="<%= get_next_result_set_type %>">
      <td><%= dc.target_date %></td>
      <td><%= link_to sprintf("%03d", dc.youth_id), :controller => 'youth', :action => 'edit', :id => dc.youth_id %></td>
      <td><%= dc.data_collection_type.name %></td>
      <td><%= dc.calculate_status %></td>
      <td><%= dc.youth.nil? || dc.youth.institution.nil? ? '' : dc.youth.institution.name %></td>
      <td><%= dc.youth.nil? || dc.youth.data_collector.nil? ? '' : dc.youth.data_collector.name %></td>
    </tr>
  <% end %>
</table>

